<?php

namespace App\Models;

use App\User;
use Illuminate\Database\Eloquent\Model;

/**
 * Class Comment
 * @package App\Models
 * @mixin \Eloquent
 */
class Comment extends Model
{
    protected $table = 'comment';
    protected $guarded = [];

    /**
     * 获取所有拥有的 commentable 模型。
     */
    public function commentable()
    {
        return $this->morphTo();
    }

    public function user(){
        return $this->belongsTo(User::class);
    }



}
